package com.itholmes.factory;

public class MainTest {
	public static void main(String[] args) {
		//这样我们new一个工厂对象，通过工厂对象来获取其他的对象，这就是一个工厂效果
		ShapeFactory shapeFactory = new ShapeFactory();
		
		Shape circle = shapeFactory.getShape("circle");
		circle.draw();
		
		Shape rectangle = shapeFactory.getShape("rectangle");
		rectangle.draw();
		
		Shape square = shapeFactory.getShape("square");
		square.draw();
	} 
}
